<?php
$sch = new Swoole\Coroutine\Scheduler;
//创建一个协程
$sch->add(function () use ($sch) {
    //在协程里面创建一个协程HTTP服务
    $server = new Swoole\Coroutine\http\Server("0.0.0.0", 3333);
    $server->handle("/",function ($request, $response) {
        $response->end("<h1>Index</h1>");
    });
    $server->start();
});
$sch->start();